import request from '@/utils/request'

/**
 * 根据关键字获取搜索建议
 * @param {*} q 搜索关键字
 * @returns
 */
export const getSearchSuggestion = q => {
  return request({
    url: '/v1_0/suggestion',
    params: {
      q
    }
  })
}

/**
 * 根据关键字获取搜索结果
 * @param {*} params { page per_page q }
 * @returns
 */
export const getSearchResults = params => {
  return request({
    url: '/v1_0/search',
    params
  })
}
